package ycl.common.enums;

import lombok.Getter;

/**
 * 发送信息状态
 *
 * @author ycl
 * @date 2022/6/25 0025 23:04:54
 */
@Getter
public enum SendStatusEnum {
	SUCCESS(1, "发送成功"),
	FAIL(0, "发送失败"),
	SEND_MAX_COUNT(-1, "获取次数达上限");

	public final int status;
	public final String msg;

	SendStatusEnum(int status, String msg) {
		this.status = status;
		this.msg = msg;
	}


	public static SendStatusEnum get(Object o){
		try {
			int status = (int) o;
			for (SendStatusEnum v : SendStatusEnum.values()) {
				if (status==v.status)
					return v;
			}
		}catch (ClassCastException ignored){
		}
		return null;
	}
}
